package cn.kmust.booth.portal.controller;



import cn.kmust.booth.portal.model.Booth;
import cn.kmust.booth.portal.service.IBoothService;
import cn.kmust.booth.portal.vo.BoothUserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tedu.cn
 * @since 2020-08-09
 */
@RestController
@RequestMapping("/portal/booth")
public class BoothController {

    @Autowired
    private IBoothService iBoothService;


    //http://localhost:8081/portal/booth/selectById?id=2
    @GetMapping("selectById")
    public Booth selectById(int id) {
        return iBoothService.selectById(id);
    }

    //http://localhost:8081/portal/booth/findBoothUser
    //访问页面   http://localhost:8081/src/views/apply.html
//    @GetMapping("findBoothUser")
//    public List<BoothUserVO> boothUser() {
//        return iBoothService.findBoothUser();
//    }
    
    //http://localhost:8081/portal/booth/findBoothUser/{id}
    @GetMapping("findBoothUser/{id}")
    public BoothUserVO boothUserVO(@PathVariable("id") int id){
        return iBoothService.findBoothUser(id);
    }

}
